import com.kuang.service.UserServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyText {
    public static void main(String[] args) {
        //获取ApplicationContext
     ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");

        UserServiceImpl userServiceImpl=(UserServiceImpl) context.getBean("UserServiceImpl");
         userServiceImpl.getUser();
    }
}
